<div ng-cloak ng-controller="pccMainController">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                    </div>
                    <h4 class="panel-title">票据商城</h4>
                </div>
                <div class="panel-body">
                    <div class="form-inline filter-option">
                        <div class="filterArea col-md-12 col-xs-12">
                            <div class="col-md-12 col-xs-12" style="padding-left:0;padding-top:20px;">
                                <section>
                                    <label>票面金额</label>
                                    <input class="bill_pcc_price" ng-model="filter.bill_sum_price" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" placeholder="票面金额" />&nbsp;<i style="color:#333;">万</i>
                                </section>
                                <div class="sec_date">
                                    <label style="color:#999;width:84px;text-align:center;">到期日期</label>
                                    <input type="text" ng-model="filter.dead_date" class="bill_pcc_date" readonly uib-datepicker-popup is-open="datepicker.dead_date" ng-click="datepicker.dead_date=!datepicker.dead_date" required />
                                    <!--<input type="text" id="setup_times" class="form-control bill_pcc_date" ng-model="filter.dead_date" required style="padding-left:4px;"/>-->
                                    <!--<input id="producttime" type="text" class="bill_pcc_date" uib-datepicker-popup is-open="datepicker.dead_date"
                                           ng-model="filter.dead_date" placeholder="大于当前日期" ng-click="datepicker.dead_date=!datepicker.dead_date" ng-blur="datachance(filter.dead_date)" required />-->
                                </div>
                                <section ng-if="filter.bill_sum_price == '' || filter.dead_date == ''">
                                    <label>承兑机构</label>
                                    <span ng-class="{true:'acctive_on',false:''}[filter.accept_type_ids == '' || filter.accept_type_ids.length == 0]" ng-click="acceptTypeAllChange()">不限</span>
                                    <span ng-class="{true:'acctive_on',false:''}[filter.accept_type_ids.indexOf('401') != -1]" ng-click="acceptTypeChange('401')">国股</span>
                                    <span ng-class="{true:'acctive_on',false:''}[filter.accept_type_ids.indexOf('402') != -1]" ng-click="acceptTypeChange('402')">城商</span>
                                    <span ng-class="{true:'acctive_on',false:''}[filter.accept_type_ids.indexOf('404') != -1]" ng-click="acceptTypeChange('404')">三农</span>
                                    <span ng-class="{true:'acctive_on',false:''}[filter.accept_type_ids.indexOf('405') != -1]" ng-click="acceptTypeChange('405')">村镇</span>
                                    <span ng-class="{true:'acctive_on',false:''}[filter.accept_type_ids.indexOf('406') != -1]" ng-click="acceptTypeChange('406')">外资</span>
                                    <span ng-class="{true:'acctive_on',false:''}[filter.accept_type_ids.indexOf('407') != -1]" ng-click="acceptTypeChange('407')">财务公司</span>
                                    <span ng-class="{true:'acctive_on',false:''}[filter.accept_type_ids.indexOf('408') != -1]" ng-click="acceptTypeChange('408')">商票</span>
                                </section>
                                <section ng-if="filter.bill_sum_price != '' && filter.dead_date != ''">
                                    <label>承兑机构</label>
                                    <span>不限</span>
                                    <span ng-class="{'acctive_on':(filter.accept_type_ids1 == '401')}" ng-click="acceptTypeChange1('401')">国股</span>
                                    <span ng-class="{'acctive_on':(filter.accept_type_ids1 == '402')}" ng-click="acceptTypeChange1('402')">城商</span>
                                    <span ng-class="{'acctive_on':(filter.accept_type_ids1 == '404')}" ng-click="acceptTypeChange1('404')">三农</span>
                                    <span ng-class="{'acctive_on':(filter.accept_type_ids1 == '405')}" ng-click="acceptTypeChange1('405')">村镇</span>
                                    <span ng-class="{'acctive_on':(filter.accept_type_ids1 == '406')}" ng-click="acceptTypeChange1('406')">外资</span>
                                    <span ng-class="{'acctive_on':(filter.accept_type_ids1 == '407')}" ng-click="acceptTypeChange1('407')">财务公司</span>
                                    <span ng-class="{'acctive_on':(filter.accept_type_ids1 == '408')}" ng-click="acceptTypeChange1('408')">商票</span>
                                </section>
                                <section ng-if="filter.bill_sum_price == '' || filter.dead_date == ''">
                                    <label>背书瑕疵</label>
                                    <span ng-class="{'acctive_on':(filter.bill_flaws1 == '')}" ng-click="flawTypeAllChange()">不限</span>
                                    <span ng-class="{'acctive_on':(filter.bill_flaws1 == 1)}" ng-click="flawTypeChange(1)">无瑕疵</span>
                                    <span ng-class="{'acctive_on':(filter.bill_flaws1 == 2)}" ng-click="flawTypeChange(2)">有瑕疵</span>
                                </section>
                                <section ng-if="filter.bill_sum_price != '' && filter.dead_date != ''">
                                    <label>背书瑕疵</label>
                                    <span>不限</span>
                                    <span ng-class="{'acctive_on':(filter.bill_flaws2 == 1)}" ng-click="flawTypeChange1(1)">无瑕疵</span>
                                    <span ng-class="{'acctive_on':(filter.bill_flaws2 == 2)}" ng-click="flawTypeChange1(2)">有瑕疵</span>
                                </section>
                                <section>
                                    <label>报价方式</label>
                                    <span ng-class="{'acctive_on':(filter.for_export == '')}" ng-click="exportTypeAllChange()">不限</span>
                                    <span ng-class="{'acctive_on':(filter.for_export == 1)}" ng-click="exportTypeChange(1)">行口</span>
                                    <span ng-class="{'acctive_on':(filter.for_export == 2)}" ng-click="exportTypeChange(2)">货款</span>
                                </section>
                            </div>
                            <p class="row-thr col-md-12 col-xs-12">
                                <span class="col-fir col-md-10 col-xs-10"></span>
                                <span class="col-sec filterBtn col-md-2 col-xs-2">
                                    <button class="clear deleteFilter" ng-click="clear()">
                                        清空
                                    </button>
                                    <button class="submit changefilter" ng-click="filterWantBill()">
                                        搜索
                                    </button>
                                </span>
                            </p>
                        </div>
                    </div>

                    <div class="list-title col-md-12 col-xs-12">
                        <span class="title-word">
                            <span class="smallBlock"></span>
                            报价信息
                            <span class="fast-order-by fast-order-by1">
                                <span>快速排序：</span>

                                <span ng-click="billOfferTimeSort()" style="cursor:pointer;margin-right:35px;position:relative;" ng-class="{'click_in':filter.showTime1}">
                                    报价时间
                                    <span style="position: absolute;top:-6px;left:74px;">
                                        <em class="glyphicon glyphicon-triangle-top" style="position:absolute;top:2px;color: #ccc;" ng-class="{'click_in1':filter.showTimeEm && filter.showTime1}"></em>
                                        <em class="glyphicon glyphicon-triangle-bottom" style="color:#ccc;" ng-class="{'click_in1':!filter.showTimeEm && filter.showTime1}"></em>
                                    </span>
                                </span>

                                <span ng-if="filter.showChoose && filter.bill_sum_price != '' && filter.dead_date != ''" ng-click="billEveryPlusSort()" style="cursor:pointer;margin-right:35px;position:relative;" ng-class="{'click_in':filter.showPlus1}">
                                    每十万扣
                                    <span style="position: absolute;top:4px;left:70px;">
                                        <em class="glyphicon glyphicon-triangle-top" style="position:absolute;top:6px;color: #ccc;" ng-class="{'click_in1':filter.showPlusEm && filter.showPlus1}"></em>
                                        <em class="glyphicon glyphicon-triangle-bottom" style="color:#ccc;" ng-class="{'click_in1':!filter.showPlusEm && filter.showPlus1}"></em>
                                    </span>
                                </span>
                            </span>
                        </span>
                    </div>

                    <table id="data-table" ng-table="tableParams" template-pagination="template/pagination.html" class="table table-striped table-bordered table-hover table-condensed">
                        <tr ng-repeat="item in $data">
                            <!--<td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>-->
                            <td data-title="'报价时间'" sortable="" class="text-center">{{ item.offerTime }}</td>
                            <td data-title="'报价机构'" sortable="" class="text-center">{{ item.enterpriseId < 0 ? '--' : item.enterpriseName }}</td>
                            <td data-title="'每十万扣'" sortable="" class="text-center">{{item.discountAmount > 0 ? item.discountAmount : '--'}}{{item.discountAmount > 0 ? '元':''}}</td>
                            <td data-title="'加价利率'" sortable="" class="text-center">{{(item.billRate == '' || item.billRate == null || item.billRate == 0) ? '':item.billRate}}{{(item.billRate == '' || item.billRate == null || item.billRate == 0) ? '' : '%'}}<i ng-if="item.billEveryPlus != 0 && (item.billRate != null)">+</i>{{item.billEveryPlus == null || item.billEveryPlus == 0 ? '' : item.billEveryPlus}}</td>
                            <td data-title="'承兑机构'" sortable="" class="text-center">{{ !item.acceptorTypeName ? '不限': item.acceptorTypeName | myfilter }}</td>
                            <td data-title="'联系方式'" sortable="" class="text-center">{{item.contactPhone}}</td>
                            
                            <td class="text-center width-100 text-nowrap">
                                <button class="btn btn-info btn-xs" ng-click="showDetailData(item)">
                                    <i class="fa fa-edit"></i> 详细
                                </button>
                            </td>
                    </table>
                </div>
                <div class="modal fade" id="modal-read">
                    <div class="modal-dialog" style="width:1100px">
                        <div class="modal-content">
                            <ng-form name="resdForm" novalidate>
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                    <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>报价详情</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-horizontal">
                                        <div class="bill-check">
                                            <div class="bill-detail" style="height:340px;">
                                                <p class="bill-detail-title">报价信息</p>
                                                <div class="col-md-12">
                                                    <label class="control-label col-md-2">票据类型：</label>
                                                    <div class="col-md-4 form-margin-top">
                                                        <span>{{pccDetail.billTypeId == 101 ? '电票' : '纸票'}}</span>
                                                    </div>
                                                </div>
                                                <div class="col-md-12">
                                                    <label class="control-label col-md-2">票面金额：</label>
                                                    <div class="col-md-4 form-margin-top">
                                                        <span>{{ pccDetail.billSumPrice }}</span>
                                                    </div>
                                                </div>
                                                <div class="col-md-12">
                                                    <label class="control-label col-md-2">交易方式：</label>
                                                    <div class="col-md-4 form-margin-top">
                                                        <span>{{ pccDetail.tradeTypeId == 1801 ? '买断' : '带贴' }}</span>
                                                    </div>
                                                </div>
                                                <div class="col-md-12">
                                                    <label class="control-label col-md-2">期限：</label>
                                                    <div class="col-md-4 form-margin-top">
                                                        <span>{{ pccDetail.startTime | date:'yyyy-MM-dd' }}--{{pccDetail.endTime | date:'yyyy-MM-dd'}}</span>
                                                    </div>
                                                </div>
                                                <div class="col-md-12">
                                                    <label class="control-label col-md-2">瑕疵可收：</label>
                                                    <div class="col-md-4 form-margin-top">
                                                        <span>
                                                            {{ pccDetail.billFlawId == 1 ? '可' : '不可' }}
                                                        </span>
                                                    </div>
                                                </div>
                                                <div class="col-md-12">
                                                    <label class="control-label col-md-2">账户状态：</label>
                                                    <div class="col-md-4 form-margin-top">
                                                        <span>
                                                            <i ng-if="pccDetail.customerStatus == 0">非注册用户</i>
                                                            <i ng-if="pccDetail.customerStatus == 1">注册卖方</i>
                                                            <i ng-if="pccDetail.customerStatus == 2">注册买卖方</i>
                                                        </span>
                                                    </div>
                                                </div>
                                                <div class="col-md-12">
                                                    <label class="control-label col-md-2">报价方式：</label>
                                                    <div class="col-md-4 form-margin-top">
                                                        <span>{{pccDetail.outUsage == 0 ? '行口' : '货款'}}</span>
                                                    </div>
                                                </div>
                                                <div class="col-md-12">
                                                    <label class="control-label col-md-2">联系人姓名：</label>
                                                    <div class="col-md-4 form-margin-top">
                                                        <span>{{item.contactName}}</span>
                                                    </div>
                                                </div>
                                                <div class="col-md-12">
                                                    <label class="control-label col-md-2">原始报价：</label>
                                                    <div class="col-md-10 form-margin-top">
                                                        <span>{{ pccDetail.description }}<i style="color:#9e9e9e;">(联系我们时请先告知在汇票线平台看到的求购信息。)</i></span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i class="fa fa-share-square-o"></i> 关闭</button>
                                </div>
                            </ng-form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
